home *** CD-ROM | disk | FTP | other *** search
- /* flipblock_allcmd.omed - arexx-script for octamed.
- Flips the block including all the cmd-pages.
- Made by Kjetil S. Matheussen 1998.
-
- Based on an arexx-script made by David T. Krupicz.
- Changes: Rewritten it to work properly, included cmd-pages,
- included all tracks in block, included highlight-flip,
- and improoved speed with around 75%.
- */
-
- OPTIONS RESULTS
-
- ed_getnumtracks VAR numtracks
- ed_getnumpages VAR numpages
-
- ed_getnumlines VAR rn_end
- rn_end=rn_end-1
- length = rn_end/2
-
- op_update off
- DO e=0 to length /* flip highlights first */
- drop top_high bot_high
- ed_getlinehighlight e VAR top_high
- ed_getlinehighlight rn_end-e VAR bot_high
- if ~(bot_high=top_high) then do
- if bot_high=1 then do
- ed_highlightline rn_end - e OFF
- ed_highlightline e ON
- end;else do
- ed_highlightline rn_end - e ON
- ed_highlightline e OFF
- end
- end
- END
- op_update on
-
- DO r = 0 to numtracks-1
- op_update off
- DO i = 0 to length
- drop top_note top_inum bot_note bot_inum
- ed_getdata 't' r 'l' i 'note' VAR top_note /* get top note data */
- ed_getdata 't' r 'l' i 'inum' VAR top_inum
- ed_getdata 't' r 'l' rn_end - i 'note' VAR bot_note /* get BOTtom note data */
- ed_getdata 't' r 'l' rn_end - i 'inum' VAR bot_inum
- if ~(bot_note=top_note) then do
- ed_setdata 't' r 'l' i 'note' bot_note
- ed_setdata 't' r 'l' rn_end - i 'note' top_note
- end
- if ~(bot_inum=top_inum) then do
- ed_setdata 't' r 'l' i 'inum' bot_inum
- ed_setdata 't' r 'l' rn_end - i 'inum' top_inum
- end
- DO l = 1 TO numpages
- drop top_cmdnum top_qual bot_cmdnum bot_qual
- ed_getdata 't' r 'l' i 'p' l 'cmdnum' VAR top_cmdnum
- ed_getdata 't' r 'l' i 'p' l 'qual' VAR top_qual
- ed_getdata 't' r 'l' rn_end - i 'p' l 'cmdnum' VAR bot_cmdnum
- ed_getdata 't' r 'l' rn_end - i 'p' l 'qual' VAR bot_qual
- if ~(bot_cmdnum=top_cmdnum) then do
- ed_setdata 't' r 'l' i 'p' l 'cmdnum' bot_cmdnum
- ed_setdata 't' r 'l' rn_end - i 'p' l 'cmdnum' top_cmdnum
- end
- if ~(bot_qual=top_qual) then do
- ed_setdata 't' r 'l' i 'p' l 'qual' bot_qual
- ed_setdata 't' r 'l' rn_end - i 'p' l 'qual' top_qual
- end
- END
- END
- op_update on
- END